package top.kuanghua.basisfunc.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 品牌表实体类
 *
 * @author 熊猫哥
 * @since 2022-12-16 14:42:22
 */
@Data
@ApiModel("品牌表")
@TableName(value = "tb_brand")
public class Brand extends Model<Brand> {
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "品牌id", hidden = false, required = false)
    private Integer id;
    @ApiModelProperty(value = "品牌名称", hidden = false, required = true)
    @NotBlank(message = "name不能为空")
    private String name;
    @ApiModelProperty(value = "品牌图片地址", hidden = false, required = true)
    @NotBlank(message = "image不能为空")
    private String image;
    @ApiModelProperty(value = "品牌的首字母", hidden = false, required = true)
    @NotBlank(message = "letter不能为空")
    private String letter;
    @ApiModelProperty(value = "排序", hidden = false, required = true)
    @NotBlank(message = "seq不能为空")
    private String seq;
    @ApiModelProperty(value = "创建时间", hidden = true, required = false)
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @ApiModelProperty(value = "更新时间", hidden = true, required = false)
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;
    @TableLogic
    @ApiModelProperty(value = "是否删除", hidden = true, required = false)
    private Integer deleted;

    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
